package kr.ac.kaist.simplefileexplorer;

import com.google.android.gcm.GCMRegistrar;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;

public class MenuMainActivity extends Activity {

	final String SENDER_ID = "78421744785";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_menu_main);

		ImageButton seeSharedBtn = (ImageButton) findViewById(R.id.exploreFilesButton);
		seeSharedBtn.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {

				Intent seeSharedIntent = new Intent(getApplicationContext(),
						SeeSharedActivity.class);
				startActivity(seeSharedIntent);
			}
		});

		ImageButton seeMyFileBtn = (ImageButton) findViewById(R.id.shareFilesButton);
		seeMyFileBtn.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {

				Intent seeSharedIntent = new Intent(getApplicationContext(),
						SeeMyFileActivity.class);
				startActivity(seeSharedIntent);
			}
		});

		GCMRegistrar.checkDevice(this);
		GCMRegistrar.checkManifest(this);
		final String regId = GCMRegistrar.getRegistrationId(this);
		if ("".equals(regId))
			GCMRegistrar.register(this, SENDER_ID);
		else
			Log.d("===> My RegistrationId", regId);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.service_select, menu);
		return true;
	}

}
